﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Helpers;


namespace QuanLyThuVien
{
    public partial class Form1 : RibbonForm
    {
        public Form1()
        {
            InitializeComponent();
            InitSkinGallery(); InitGrid();
            ucTraCuuSach1.BringToFront();
            groupQuanLyDocGia.Visible = false;
            groupQuanLySach.Visible = false;
            groupBaoCao.Visible = false;
            ribQuanLy.Visible = false;
            iThoat.Visibility = BarItemVisibility.Never;
        }
        void InitSkinGallery()
        {
            SkinHelper.InitSkinGallery(rgbiSkins, true);
        }
        void InitGrid()
        {
            //BindingList<Person> gridDataList = new BindingList<Person>();
            //gridDataList.Add(new Person("Joth", "Smith"));
            //gridDataList.Add(new Person("Gabriel", "Smith"));
            //gridDataList.Add(new Person("Ashley", "Smith", "some comment"));
            //gridDataList.Add(new Person("Adrian", "Smith", "some comment"));
            //gridDataList.Add(new Person("Gabriella", "Smith", "some comment"));
            //gridControl.DataSource = gridDataList;
        }

        private void barTiepNhanNhanVien_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucHoSoNhanVien1.BringToFront();
        }

        private void barLapTheDocGia_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucLapTheDocGia1.BringToFront();
        }

        private void barTiepNhanSach_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucTiepNhanSachMoi1.BringToFront();
        }

        private void barTraCuu_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucTraCuuSach1.BringToFront();
        }

        private void ucPhieuMuonSach1_Load(object sender, EventArgs e)
        {

        }

        private void barMuonSach_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucPhieuMuonSach1.BringToFront();
        }

        private void barTraSach_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucPhieuTraSach1.BringToFront();
        }

        private void barThuTienPhat_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucPhieuThuTienPhat1.BringToFront();
        }

        private void barGhiNhanMatSach_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucGhiNhanMatSach1.BringToFront();
        }

        private void barThongKeSach_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucBaoCaoThongKeSachTraTre1.BringToFront();
        }

        private void barThongKeMuonSach_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucBaoCaoThongKeMuonSach1.BringToFront();
        }

        private void barThongKeDocGia_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucBaoCaoThongKeDocGiaNo1.BringToFront();
        }

        private void iTiepNhanSach_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucTiepNhanSachMoi1.BringToFront();
        }

        private void iThanhLy_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucThanhLySach1.BringToFront();
        }

        private void biTraCuu_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucTraCuuSach1.BringToFront();
        }

        private void iMuonSach_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucPhieuMuonSach1.BringToFront();
        }

        private void iTraSach_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucPhieuTraSach1.BringToFront();
        }

        private void iLapTheDocGia_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucLapTheDocGia1.BringToFront();
        }

        private void iThongKeSach_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucBaoCaoThongKeSachTraTre1.BringToFront();
        }

        private void iThongKeMuonSach_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucBaoCaoThongKeMuonSach1.BringToFront();
        }

        private void iThongKeDocGia_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucBaoCaoThongKeDocGiaNo1.BringToFront();
        }

        private void barDangNhap_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucDangNhap1.BringToFront();
        }

        private void iDangNhap_ItemClick(object sender, ItemClickEventArgs e)
        {
            ucDangNhap1.BringToFront();
        }

        private void barThanhLySach_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            ucThanhLySach1.BringToFront();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        public void DangNhapThanhCong()
        {
            groupQuanLyDocGia.Visible = true;
            groupQuanLySach.Visible = true;
            groupBaoCao.Visible = true;
            ribQuanLy.Visible = true;
            ucTraCuuSach1.BringToFront();
            iDangNhap.Visibility = BarItemVisibility.Never;
            iThoat.Visibility = BarItemVisibility.Always;
        }
        public void Thoat()
        {
            groupQuanLyDocGia.Visible = false;
            groupQuanLySach.Visible = false;
            groupBaoCao.Visible = false;
            ribQuanLy.Visible = false;
            ucTraCuuSach1.BringToFront();
            iDangNhap.Visibility = BarItemVisibility.Always;
            iThoat.Visibility = BarItemVisibility.Never;
        }

        private void iThoat_ItemClick(object sender, ItemClickEventArgs e)
        {
            Thoat();
            MessageBox.Show("Thoát Đăng Nhập!!!");
            siStatus.Caption = "Thoát Đăng Nhập";

        }

        private void iExit_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.Close();
        }
    }
}